<template>
   <div class="Student">
      <p>{{ ming }}</p>
      <button @click="test02()">点我给上方传参</button>
      <p>接收的姓名：{{ asd.name }}</p>
      <p>接收的年龄：{{ asd.age }}</p>
     
   </div>
</template>
<script>
import BaseDao from "../utils/BaseDao";
export default {
   name: 'Student',
   components: {
      BaseDao
     
   },
   mixins: [],
   props: {
     
   },
   data() {
     return {
      ming:'我是学生组件',
      asd:{},
      lol:{
         name:'轻微',
         age:'33'
      }
       
     }
   },
   computed: {
     
   },
   watch: {
     
   },
   mounted() {
     
   },
   methods: {
      // 用于传递参数
      test02(){
         BaseDao.$emit('lol',this.lol)


      }
     
   },
   // 用于接受参数
   beforeCreate(){
            BaseDao.$on('data',(data)=>{
               this.asd=data


            })


   }
};
</script>
<style  scoped>
.Student{
    background-color: blueviolet;
    height: 300px;
    width: 300px;
}
</style>